<?php
/**
 * CreateTime: 2022/7/7 17:38
 */

namespace App\Tools\Log;

use App\Models\Approval\DingTalkErrorModel;

class DingTalkLog
{
    public static function errDingTalkLog($exception,$id){
        $errMsg = json_encode([
            'message' => $exception->getMessage(),
            'line' => $exception->getLine(),
            'file' => $exception->getFile(),
        ]);
        $dm = new DingTalkErrorModel();
        return $dm->addError([
            'ding_talk_error' => $errMsg,
            'ding_talk_process_id' => $id
        ]);
    }
}